var RATE = RATE || {};

RATE.showPage = function(){
	$("#menucontent").children().hide();
	$("#submenu_rating").show();
	$("#post").show();
}

RATE.initPage = function(){
	$('#postReview').submit(function(){
			var comments = $(this).find('textarea').val();
			var rating = $('.star-rating-on').length;
			var dataString = 'comments=' + comments + "&rating=" + rating;
			$.ajax({
				type: 'POST',
				url: 'PostReview.jsp',
				data: dataString,
				success: function(data){
					var p = '<p>No. ' + data + ' :' + comments + '</p>';
					$('div.entry').append($(p));
					$('#inputtextarea').val('');
				}
			});
			return false;
	});
}